package com.snowy.hidden.exception;

/**
 * 用户错误信息
 */
public enum UserErrorENU implements TxzhException {

    //U0开头的定义为系统层面的异常
    DATA_CONVERT_ERROR("U0001", "【%s】数据转换异常"),
    //U1开头的定义为用户信息的异常
    TOKEN_INVALID("U1001", "token已失效"),
    USER_INFO_CONVERT_FAIL("U1002", "用户信息获取失败"),
    //U2开头的定义为用户信息参数异常
    USER_PARAMS_NOT_NULL("U2001", "参数【%s】不能为空"),
    OBJECT_NOT_FOUND("U2002", "【%s】信息未找到"),
    //U3开头为游记的错误
    TRAVELS_STATUS_ERROR("U3001", "游记状态错误"),
    NOT_DELETE_NON_SELF_MSG("U3002", "不能删除非本人的信息"),
    TRAVELS_DELETED("U3003", "游记已经删除"),
    //U4推送消息的错误
    USER_PUSH_PARAMS_NOT_NULL("U4001", "参数【%s】不能为空"),
    //U5定义为评论
    USER_CRITICISM("U5001", "非法的评论"),
    //U6定义为联系人异常
    USER_LINKMAN_REPEAT("U6001", "联系人重复"),
    MGR_VALIDATE_ERR("U7001", "非管理员");


    private String code;

    private String msg;

    UserErrorENU(String code, String msg) {
        this.code = code;
        this.msg = msg;
    }

    @Override
    public String getCode() {
        return code;
    }

    @Override
    public void setCode(String code) {
        this.code = code;
    }

    @Override
    public String getMsg() {
        return msg;
    }

    @Override
    public void setMsg(String msg) {
        this.msg = msg;
    }

}
